package myhomework;

public class Work9 {
    public static void main(String[] args) {
        int N=10;
        String bin=d2B(N);
        System.out.println(bin);
    }
    public static String d2B(int elem){
        if(elem==0){
            return "0";
        }
        int[] bArry=new int[32];
        String binary="";
        if(elem%2!=0){
//            binary=binary+(""+(elem/2));
            binary= d2B(elem/2)+"1";

//            binary=binary+(elem/2);
        }else {
            binary=d2B(elem/2)+"0";
        }
        return binary;
    }
}
